// 默认暴露
import {reactive,onMounted,onBeforeUnmount}from 'vue'
export default function(){
    let pointObj = reactive({
        x: 0, y: 0
    })
    function savePoint(e) {
        pointObj.x = e.pageX
        pointObj.y = e.pageY
        console.log(e.pageX, e.pageY);
    }
    onMounted(() => {
        window.addEventListener('click', savePoint)
    })
    onBeforeUnmount(() => {
        window.removeEventListener('click', savePoint)
    })
    return {pointObj}
}